package com.yzq.mapper;

import com.yzq.model.entity.Comments;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author yezhi
* @description 针对表【comments(评论表)】的数据库操作Mapper
* @createDate 2025-07-07 14:27:55
* @Entity com.yzq.model.entity.Comments
*/
public interface CommentsMapper extends BaseMapper<Comments> {
    /**
     * 根据图片ID查询评论及其子评论
     * @param pictureId 图片ID
     * @return 评论列表
     */
    List<Comments> getCommentsByPictureId(@Param("pictureId") Long pictureId);

    /**
     * 根据父评论ID查询子评论
     * @param parentId 父评论ID
     * @return 子评论列表
     */
    List<Comments> getChildComments(@Param("parentId") Long parentId);
}




